home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / jpl_c.zip / ISOK.C < prev    next >
Text File  |  1986-05-18  |  896b  |  30 lines

  1. /* 1.0  01-22-85 */
  2. /************************************************************************
  3.  *            Robert C. Tausworthe                *
  4.  *            Jet Propulsion Laboratory            *
  5.  *            Pasadena, CA 91009        1985        *
  6.  ************************************************************************/
  7.  
  8. #include "defs.h"
  9. #include "stdtyp.h"
  10.  
  11. /************************************************************************/
  12.     BOOL
  13. isok(prompt)        /* Output prompt to stdout and accept y/n answer.
  14.                Return TRUE for y, FALSE for n.        */
  15. /*----------------------------------------------------------------------*/
  16. STRING prompt;
  17. {
  18.     STRING getns();
  19.     char c, ans[2];
  20.  
  21.     FOREVER
  22.     {    getns(prompt, ans, 1);
  23.         c = tolower(*ans);
  24.         if ((c IS 'y') OR (c IS 'n'))
  25.             break;
  26.         puts("\nPlease respond with 'y' or 'no'.");
  27.     }
  28.     return ((c IS 'y') ? TRUE : FALSE);
  29. }
  30.